algebraic approach to this one